package cn.wcy.design_patterns.test.Controller.demo2;

import org.springframework.stereotype.Service;

/**
 * 预算计划
 *
 * @author wcy
 * @date 2024/06/15
 */
@Service("BudgetPlan")
public class BudgetPlan {

    public long query(Period period) {
        return BudgetRepo.budgets.stream().mapToLong(budget -> budget.getOverlappingAmount(period)).sum();
    }
}
